home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XA_6S.ZIP / SOURCE / OBJECTS.SRC / PROGDEF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-08  |  1.3 KB  |  54 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. #include <stdlib.h>
  9. #include <osbind.h>
  10. #ifdef LATTICE
  11. #undef abs        /* MiNTlib (PL46) #define is buggy! */
  12. #define abs(i)    __builtin_abs(i)
  13. #endif
  14. #include "XA_DEFS.H"
  15. #include "XA_TYPES.H"
  16. #include "XA_GLOBL.H"
  17. #include "K_DEFS.H"
  18. #include "RECTLIST.H"
  19. #include "BOX3D.H"
  20. #include "objects.h"
  21.  
  22. extern short global_clip[4];    /* Bloody progdefs need to know the clip rectangle */
  23.  
  24. void d_g_progdef(ODC_PARM *odc_p)
  25. {
  26.     OBJECT *ob=odc_p->tree + odc_p->object;
  27.     APPLBLK *ab;
  28.     PARMBLK p;
  29.     
  30.     ab=(APPLBLK*)ob->ob_spec;
  31.     p.pb_tree=odc_p->tree;
  32.     p.pb_obj=odc_p->object;
  33.  
  34.     p.pb_prevstate=p.pb_currstate=ob->ob_state;
  35.                 
  36.     p.pb_x=odc_p->parent_x+ob->ob_x;
  37.     p.pb_y=odc_p->parent_y+ob->ob_y;
  38.     p.pb_w=ob->ob_width;
  39.     p.pb_h=ob->ob_height;
  40.                 
  41.     p.pb_xc=global_clip[0];
  42.     p.pb_yc=global_clip[1];
  43.     p.pb_wc=global_clip[2]-global_clip[0]+1;
  44.     p.pb_hc=global_clip[3]-global_clip[1]+1;
  45.     
  46.     p.pb_parm=ab->ab_parm;
  47.         
  48.         /* The PROGDEF function returns the ob_state bits that
  49.             remain to be handled by the AES: */
  50.     *odc_p->state_mask = (short)(*(ab->ab_code))(&p);
  51.         /* BUG: SELECTED bit only handled in non-color mode!!! */
  52.         /* (Not too serious I believe... <mk>) */
  53.  
  54. }